package sctu.edu.java.year2016.team08.chenjing.day20160525.chapter7_2;

/**
 * Created by AD on 2016/5/25.
 * 尝试编写一个矩形类，将长和宽作为矩形类的属性，在构造方法中将长、宽初始化，定义一个成员方法求此矩形的面积。
 */
public class Juxing {
    double chang;
    double kuan;

    public Juxing(double chang, double kuan) {
        this.chang = chang;
        this.kuan = kuan;
    }

    public double Square() {
        double s;
        s = chang * kuan;
        System.out.println("面积为:" + s);
        return s;
    }
}
